package com.ruoyi.web.service.impl;

import com.ruoyi.web.entity.Custom;
import com.ruoyi.web.mapper.CustomMapper;
import com.ruoyi.web.service.ICustomService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lqc
 * @since 2024-01-26
 */
@Service
public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> implements ICustomService {

    private final CustomMapper customMapper;
    public CustomServiceImpl(CustomMapper customMapper){
        this.customMapper = customMapper;
    }
    /**
     * 查询客户
     *
     * @param id 客户主键
     * @return 客户
     */
    @Override
    public Custom selectCustomById(Long id)
    {
        return customMapper.selectCustomById(id);
    }

    /**
     * 查询客户列表
     *
     * @param custom 客户
     * @return 客户
     */
    @Override
    public List<Custom> selectCustomList(Custom custom)
    {
        return customMapper.selectCustomList(custom);
    }

    /**
     * 新增客户
     *
     * @param custom 客户
     * @return 结果
     */
    @Override
    public int insertCustom(Custom custom)
    {
        return customMapper.insertCustom(custom);
    }

    /**
     * 修改客户
     *
     * @param custom 客户
     * @return 结果
     */
    @Override
    public int updateCustom(Custom custom)
    {
        return customMapper.updateCustom(custom);
    }

    /**
     * 批量删除客户
     *
     * @param ids 需要删除的客户主键
     * @return 结果
     */
    @Override
    public int deleteCustomByIds(Long[] ids)
    {
        return customMapper.deleteCustomByIds(ids);
    }

    /**
     * 删除客户信息
     *
     * @param id 客户主键
     * @return 结果
     */
    @Override
    public int deleteCustomById(Long id)
    {
        return customMapper.deleteCustomById(id);
    }
}
